<!DOCTYPE html>
<html>
<head>
<style>
  html {
    background-color: red;
  }
</style>
<script>
window.addEventListener("load", function () {
  document.querySelector("html").style.backgroundColor = "green";
}, false);
</script>
</head>
<body>
</body>
</html>